package com.lino.design;

import com.lino.design.util.RedisUtils;

/**
 * @description: 活动控制层
 * @author: lingjian
 * @createDate: 2022/12/22 16:14
 */
public class ActivityController {

    private RedisUtils redisUtils = new RedisUtils();

    public Activity queryActivityinfo(Long id) {
        Activity activity = ActivityFactory.getActivity(id);
        // 模拟从Redis中获取库存变化信息
        Stock stock = new Stock(1000, redisUtils.getStockUsed());
        activity.setStock(stock);
        return activity;
    }
}
